<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <a href="http://www.baidu.com">跳转到百度</a>
  <a href="http://www.jingdong.com">跳转到京东</a>

  <div>div1</div>
  <div>div2</div>
  <div>div3</div>
  <script>
    // 查找单个元素
    const link = document.querySelector('a')
    console.log(link)

    // 查找多个元素
    const divs = document.querySelectorAll('div')
    console.log(divs)
    console.log(divs[0])
  </script>
</body>

</html>